package com.ebraga.trackerclub.android.view;

import android.app.Activity;
import android.content.Context;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;

public class GpsActivity extends Activity {

	private LocationListener locationListener;
    private LocationManager lm;
    
    @Override
    public void onDestroy() {
        super.onDestroy();
        lm.removeUpdates(locationListener);
    }    	
	

    @Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);

		locationListener = new MyLocationListener(getApplicationContext());

		if (lm.isProviderEnabled(LocationManager.NETWORK_PROVIDER)) {

			lm.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0,
					locationListener);

		}

		if (lm.isProviderEnabled(LocationManager.GPS_PROVIDER)) {

			lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0,
					locationListener);

		}		
		


	}
    

	
}